package br.ita.doacoes.view.controledoacoes;

import java.util.List;

import javax.swing.DefaultComboBoxModel;

import br.ita.doacoes.core.templates.DAO;
import br.ita.doacoes.core.templates.GenericDAOJPA;
import br.ita.doacoes.domain.cadastrodoacoes.TipoItem;
import br.ita.doacoes.domain.cadastrofamilia.Familia;
import br.ita.doacoes.view.cadastrodoacoes.refresher.Refreshable;
import br.ita.doacoes.view.cadastrodoacoes.refresher.Refresher;

/**
 * @author Lucas Amaro
 * @since 04/12/2007
 * 
 **/
public class TipoItemCombo extends DefaultComboBoxModel implements Refreshable {

	DAO dao = new GenericDAOJPA(TipoItem.class);
	
	public TipoItemCombo() {
		refresh();
		Refresher.add(this);
	}
	
	public void refresh() {
		List lista = dao.getList();
		removeAllElements();
		for(Object obj:lista){
			addElement(obj);
		}
	}
	
	

}